home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Microsoft Plateform / Visual Basic 5.0 / Msvb50.ace / msvb50 / MSVB50 / VB / SAMPLES / VISDATA / FIND.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-10-16  |  6.4 KB  |  214 lines

  1. VERSION 5.00
  2. Begin VB.Form frmFindForm 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Find Record"
  5.    ClientHeight    =   2430
  6.    ClientLeft      =   1995
  7.    ClientTop       =   2595
  8.    ClientWidth     =   5445
  9.    Height          =   2895
  10.    HelpContextID   =   2016128
  11.    Icon            =   "FIND.frx":0000
  12.    Left            =   1935
  13.    LinkTopic       =   "Form1"
  14.    LockControls    =   -1  'True
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   2024.58
  18.    ScaleMode       =   0  'User
  19.    ScaleWidth      =   5358.743
  20.    ShowInTaskbar   =   0   'False
  21.    StartUpPosition =   1  'CenterOwner
  22.    Top             =   2190
  23.    Width           =   5565
  24.    Begin VB.OptionButton optFindType 
  25.       Caption         =   "FindLast"
  26.       Height          =   255
  27.       Index           =   3
  28.       Left            =   3120
  29.       MaskColor       =   &H00000000&
  30.       TabIndex        =   9
  31.       Top             =   1440
  32.       Width           =   2055
  33.    End
  34.    Begin VB.OptionButton optFindType 
  35.       Caption         =   "FindPrevious"
  36.       Height          =   255
  37.       Index           =   2
  38.       Left            =   3120
  39.       MaskColor       =   &H00000000&
  40.       TabIndex        =   8
  41.       Top             =   1200
  42.       Width           =   2055
  43.    End
  44.    Begin VB.OptionButton optFindType 
  45.       Caption         =   "FindNext"
  46.       Height          =   255
  47.       Index           =   1
  48.       Left            =   3120
  49.       MaskColor       =   &H00000000&
  50.       TabIndex        =   7
  51.       Top             =   960
  52.       Width           =   2055
  53.    End
  54.    Begin VB.OptionButton optFindType 
  55.       Caption         =   "FindFirst"
  56.       Height          =   255
  57.       Index           =   0
  58.       Left            =   3120
  59.       MaskColor       =   &H00000000&
  60.       TabIndex        =   6
  61.       Top             =   720
  62.       Value           =   -1  'True
  63.       Width           =   2055
  64.    End
  65.    Begin VB.ListBox lstFields 
  66.       BackColor       =   &H00FFFFFF&
  67.       Height          =   1455
  68.       Left            =   240
  69.       TabIndex        =   1
  70.       Top             =   360
  71.       Width           =   1695
  72.    End
  73.    Begin VB.ListBox lstOperators 
  74.       BackColor       =   &H00FFFFFF&
  75.       Height          =   1455
  76.       ItemData        =   "FIND.frx":030A
  77.       Left            =   2040
  78.       List            =   "FIND.frx":0311
  79.       TabIndex        =   3
  80.       Top             =   360
  81.       Width           =   960
  82.    End
  83.    Begin VB.TextBox txtExpression 
  84.       BackColor       =   &H00FFFFFF&
  85.       Height          =   285
  86.       Left            =   3120
  87.       TabIndex        =   5
  88.       Top             =   360
  89.       Width           =   2055
  90.    End
  91.    Begin VB.CommandButton cmdOK 
  92.       Caption         =   "&OK"
  93.       Default         =   -1  'True
  94.       Enabled         =   0   'False
  95.       Height          =   372
  96.       Left            =   600
  97.       MaskColor       =   &H00000000&
  98.       TabIndex        =   10
  99.       Top             =   1919
  100.       Width           =   1691
  101.    End
  102.    Begin VB.CommandButton cmdCancel 
  103.       Cancel          =   -1  'True
  104.       Caption         =   "&Cancel"
  105.       Height          =   372
  106.       Left            =   2879
  107.       MaskColor       =   &H00000000&
  108.       TabIndex        =   11
  109.       Top             =   1919
  110.       Width           =   1691
  111.    End
  112.    Begin VB.Label lblLabels 
  113.       AutoSize        =   -1  'True
  114.       Caption         =   "Operators: "
  115.       Height          =   195
  116.       Index           =   1
  117.       Left            =   2040
  118.       TabIndex        =   2
  119.       Top             =   120
  120.       Width           =   840
  121.    End
  122.    Begin VB.Label lblLabels 
  123.       AutoSize        =   -1  'True
  124.       Caption         =   "Fields: "
  125.       Height          =   195
  126.       Index           =   0
  127.       Left            =   240
  128.       TabIndex        =   0
  129.       Top             =   120
  130.       Width           =   510
  131.    End
  132.    Begin VB.Label lblLabels 
  133.       AutoSize        =   -1  'True
  134.       Caption         =   "Value or Expression: "
  135.       Height          =   195
  136.       Index           =   2
  137.       Left            =   3120
  138.       TabIndex        =   4
  139.       Top             =   120
  140.       Width           =   1515
  141.    End
  142. Attribute VB_Name = "frmFindForm"
  143. Attribute VB_Base = "0{6F48C4A9-C9E4-11CF-9ED2-00AA00574745}"
  144. Attribute VB_GlobalNameSpace = False
  145. Attribute VB_Creatable = False
  146. Attribute VB_TemplateDerived = False
  147. Attribute VB_PredeclaredId = True
  148. Attribute VB_Exposed = False
  149. Attribute VB_Customizable = False
  150. Option Explicit
  151. '>>>>>>>>>>>>>>>>>>>>>>>>
  152. Const FORMCAPTION = "Find Record"
  153. Const BUTTON1 = "&OK"
  154. Const BUTTON2 = "&Cancel"
  155. Const Label1 = "&Fields:"
  156. Const Label2 = "&Operators:"
  157. Const LABEL3 = "&Value or Expression:"
  158. '>>>>>>>>>>>>>>>>>>>>>>>>
  159. Dim mbNotFound As Integer
  160. Private Sub cmdCancel_Click()
  161.   Hide
  162.   'set the flag for the recordset/recagrid form
  163.   gbFindFailed = True
  164. End Sub
  165. Private Sub optFindType_Click(Index As Integer)
  166.   gnFindType = Index
  167. End Sub
  168. Private Sub txtExpression_Change()
  169.   cmdOK.Enabled = Len(lstFields.Text) > 0 And Len(lstOperators.Text) > 0 And Len(txtExpression.Text) > 0
  170. End Sub
  171. Private Sub lstFields_Click()
  172.   cmdOK.Enabled = Len(lstFields.Text) > 0 And Len(lstOperators.Text) > 0 And Len(txtExpression.Text) > 0
  173. End Sub
  174. Private Sub lstOperators_Click()
  175.   cmdOK.Enabled = Len(lstFields.Text) > 0 And Len(lstOperators.Text) > 0 And Len(txtExpression.Text) > 0
  176. End Sub
  177. Private Sub Form_Load()
  178.   Me.Caption = FORMCAPTION
  179.   cmdOK.Caption = BUTTON1
  180.   cmdCancel.Caption = BUTTON2
  181.   lblLabels(0).Caption = Label1
  182.   lblLabels(1).Caption = Label2
  183.   lblLabels(2).Caption = LABEL3
  184.   lstOperators.AddItem "="
  185.   lstOperators.AddItem "<>"
  186.   lstOperators.AddItem ">="
  187.   lstOperators.AddItem "<="
  188.   lstOperators.AddItem ">"
  189.   lstOperators.AddItem "<"
  190.   lstOperators.AddItem "Like"
  191.   lstOperators.ListIndex = 0
  192.   mbNotFound = False
  193. End Sub
  194. Private Sub cmdOK_Click()
  195.    On Error GoTo FindErr
  196.    Dim i As Integer
  197.    i = lstFields.ListIndex
  198.    mbNotFound = False
  199.    Screen.MousePointer = vbHourglass
  200.    gsFindField = lstFields.Text
  201.    gsFindExpr = txtExpression.Text
  202.    gsFindOp = lstOperators.Text
  203.    Hide
  204.    Screen.MousePointer = vbDefault
  205.    Exit Sub
  206. FindErr:
  207.    If Err <> gnEOF_ERR Then
  208.      ShowError
  209.    Else
  210.      mbNotFound = True
  211.      Resume Next
  212.    End If
  213. End Sub
  214.